<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>利用原型对象继承方法</title>
</head>
<body>
  <script>
    function father(name,age) {
      this.name = name;
      this.age = age;
    }
    father.prototype.money = function () {
        console.log('挣钱中......');
    }
    function Son(name,age) {
      /* 调用父函数 要传入自己的this */
      father.call(this,name,age);
    }
    Son.prototype = father.prototype;
    Son.prototype.exam = function () {
        console.log("我要考试啊。。。")
    }
    var son = new Son('cty',18);
    var f = new father();
    console.log(f) //父亲也会继承儿子的方法 不好
  </script>
</body>
</html>